package chordcows;
import java.rmi.*;
import java.rmi.registry.*;

/**
 *
 * @author chris day
 * @assignment assignment6
 */
public class RMIstub {
	public RMIstub () {

	}

	static public void main(String args[]) {
       		RMIreceiver myServer;
       		Registry registry;
       		String serverAddress = "localhost";
       		boolean success=false;
       		int serverPort = 8484;
       		String text = args[0];
       		try {
           		registry = LocateRegistry.getRegistry(serverAddress, serverPort);
           		myServer = (RMIreceiver)(registry.lookup("RMIserver"));
           		success=myServer.receiveMessage(text);
		} catch (RemoteException e) {
			
		}catch (NotBoundException e) {
    
		}
		
		if(success)
			System.exit(0);
		System.exit(1);
	}	
			
}
